import java.util.Random;

public class v2 {
    public static void main(String[] args) {
        Random random = new Random();
        int count = 0;
        int problemsPerLine = 5; // 每行显示5个算式
        int problemWidth = 20; // 每个算式的显示宽度
        int startNumber = 1; // 题号起始值
        boolean isAddition = random.nextBoolean(); // 随机选择加法或减法

        while (count < 50) {
            int operand1 = random.nextInt(101);
            int operand2 = random.nextInt(101);
            String problem = "";
            int result = 0;

            if (isAddition) {
                // 纯加法算式
                result = operand1 + operand2;
                problem = String.format("%d + %d = %d", operand1, operand2, result);
            } else {
                // 纯减法算式，确保差不为负
                operand1 = operand1 + operand2; // 保证减数大于被减数
                result = operand1 - operand2;
                problem = String.format("%d - %d = %d", operand1, operand2, result);
            }

            // 打印题号
            if (count % problemsPerLine == 0) {
                System.out.printf("%2d-%2d: ", startNumber, startNumber + problemsPerLine - 1);
            }

            // 打印算式，确保右对齐
            System.out.printf("%" + problemWidth + "s", problem);

            // 每行打印完5个算式后换行
            if ((count + 1) % problemsPerLine == 0) {
                System.out.println();
            }

            count++;
            startNumber++;
        }

        // 如果最后一行没有打印满5个算式，则换行
        if (count % problemsPerLine != 0) {
            System.out.println();
        }
    }
}